package com.awonsome.mall.ums.api;

import com.awonsome.common.core.result.Result;
import com.awonsome.mall.ums.pojo.entity.UmsAddress;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author yangdejun
 * @date 2022/1/19 10:23
 */
@FeignClient(name = "mall-ums", contextId = "address")
public interface MemberAddressFeignClient {

    /**
     * 获取地址详情
     *
     * @param id
     * @return
     */
    @GetMapping(value = "/app-api/v1/address/{id}")
    Result<UmsAddress> getById(@PathVariable("id") Long id);

    /**
     * 获取地址列表
     *
     * @param memberId
     * @return
     */
    @GetMapping(value = "/app-api/v1/addresses")
    Result<List<UmsAddress>> list(@RequestParam Long memberId);

}
